package tools.twitter;

import java.io.IOException;
import java.net.MalformedURLException;

import com.gargoylesoftware.htmlunit.BrowserVersion;
import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;

public class URLDownloader {
	public static void main(String[] args) {
		String url = "http://www.911memorial.org/";
		WebClient webClient = new WebClient(BrowserVersion.INTERNET_EXPLORER_8);
		try {
			HtmlPage page = webClient.getPage(url);
			System.out.println(page.getTitleText());
			System.out.println(page.asText());
			System.out.println(page.asXml());
			webClient.closeAllWindows();
		} catch (FailingHttpStatusCodeException e) {
			e.printStackTrace();
		} catch (MalformedURLException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}

	}
}
